import axios from 'axios'

import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

// axios.defaults.baseURL = '/api';

// 在request拦截器中展示进度条
axios.interceptors.request.use(config => {
  NProgress.start();
  // config.headers.Authorization = window.sessionStorage.getItem('token');
  return config;
})

// 在response拦截器中隐藏进度条
axios.interceptors.response.use(config => {
  NProgress.done();
  return config;
})

export default axios